home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
me_cd25.zip
/
MUTT2.ZIP
/
UNDO.MUT
< prev
next >
Wrap
Text File
|
1992-11-09
|
838b
|
41 lines
;; C Durland Public Domain
(include me2.h)
(defun
turn-on-undo
{
(buffer-flags -1 (bit-or (buffer-flags -1) BFUndo))
}
iturn-on-undo
{
(turn-on-undo)
(msg "Undo turned on for " (buffer-name -1))
}
turn-off-undo
{
(buffer-flags -1 (bit-and (buffer-flags -1) (bit-xor -1 BFUndo)))
(msg "Undo turned off for " (buffer-name -1))
}
undo
{
(switch (do-undo)
0
{
(if (== 0 (bit-and (buffer-flags -1) BFUndo))
(msg "Undo is turned off - nothing to undo!")
(msg "All undoed - undo list empty."))
}
1 (msg "Undoed")
2 (msg "Undo problems.")
)
}
MAIN
{
(bind-to-key "undo" 'C-_') ;; GNU binding
(bind-to-key "undo" "C-xu") ;; GNU binding
(register-hook IBUFFER-CREATED-HOOK "turn-on-undo")
}
)